package cn.zucc.edu.madq.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.zucc.edu.madq.dao.ClubActivitiesMapper;
import cn.zucc.edu.madq.dao.MMapper;
import cn.zucc.edu.madq.pojo.ClubActivities;
import cn.zucc.edu.madq.service.ClubActivitiesService;

@Service("clubActivitiesService")
public class ClubActivitiesServiceImpl implements ClubActivitiesService {

	@Autowired
	private ClubActivitiesMapper clubActivitiesMapper;
	@Autowired 
	private MMapper mMapper;

	@Override
	public int insert(ClubActivities ca) {
		return clubActivitiesMapper.insertSelective(ca);
	}

	@Override
	public List<Map<String, Object>> getClubActivitiesByUserId(Integer userId) {
		// TODO Auto-generated method stub
		return mMapper.getClubActivitiesByUserId(userId);
	}

	@Override
	public List<Map<String, Object>> getMyClubActivitiesByUserId(Integer userId) {
		// TODO Auto-generated method stub
		return mMapper.getMyClubActivitiesByUserId(userId);
	}

	@Override
	public int gdelMyClubActivitiesByRegisterActivitiesId(
			int registerActivitiesId) {
		return clubActivitiesMapper.deleteByPrimaryKey(registerActivitiesId);
	}

	@Override
	public List<Map<String, Object>> getCountClubActivities(int clubActivitiesId) {
		return mMapper.getCountClubActivities(clubActivitiesId);
	}

	@Override
	public List<Map<String, Object>> getCountIdAndTitle(Integer userId) {
		return mMapper.getCountIdAndTitle(userId);
	}


}
